import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/major_hazard/hazard_obligation_person_entity.dart';

HazardObligationPersonEntity $HazardObligationPersonEntityFromJson(Map<String, dynamic> json) {
  final HazardObligationPersonEntity hazardObligationPersonEntity = HazardObligationPersonEntity();
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    hazardObligationPersonEntity.avatar = avatar;
  }
  final String? hazardCode = jsonConvert.convert<String>(json['hazardCode']);
  if (hazardCode != null) {
    hazardObligationPersonEntity.hazardCode = hazardCode;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    hazardObligationPersonEntity.id = id;
  }
  final String? mobile = jsonConvert.convert<String>(json['mobile']);
  if (mobile != null) {
    hazardObligationPersonEntity.mobile = mobile;
  }
  final String? nickName = jsonConvert.convert<String>(json['nickName']);
  if (nickName != null) {
    hazardObligationPersonEntity.nickName = nickName;
  }
  return hazardObligationPersonEntity;
}

Map<String, dynamic> $HazardObligationPersonEntityToJson(HazardObligationPersonEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['avatar'] = entity.avatar;
  data['hazardCode'] = entity.hazardCode;
  data['id'] = entity.id;
  data['mobile'] = entity.mobile;
  data['nickName'] = entity.nickName;
  return data;
}

extension HazardObligationPersonEntityExtension on HazardObligationPersonEntity {
  HazardObligationPersonEntity copyWith({
    String? avatar,
    String? hazardCode,
    String? id,
    String? mobile,
    String? nickName,
  }) {
    return HazardObligationPersonEntity()
      ..avatar = avatar ?? this.avatar
      ..hazardCode = hazardCode ?? this.hazardCode
      ..id = id ?? this.id
      ..mobile = mobile ?? this.mobile
      ..nickName = nickName ?? this.nickName;
  }
}
